<!--
 * @Author: wuwk
 * @Date: 2021-12-20 13:33:05
 * @LastEditors: wuwk
 * @LastEditTime: 2021-12-22 10:20:43
 * @Description: 入库情况
-->
<template>
  <div class="wrap">
    <chartTitle title="今日入库情况" />
    <div class="block-bottom">
      <div class="b-item" v-for="item in sbrsList" :key="item.name">
        <span class="iconfont prefix" :class="item.prefixClass">&#xe629;</span>
        <span class="tit">{{ item.name }}</span>
        <dv-digital-flop :config="item.config" class="digital" />
      </div>
    </div>
  </div>
</template>

<script>
import chartTitle from "_c/chartTitle.vue";
import { numConversion } from "@/common/utils";
export default {
  name: "ProjectSbrsqk",

  components: {
    chartTitle,
  },
  data() {
    return {
      sbrsList: [
        {
          name: "上解人次",
          value: 100000,
          prefixClass: "blue",
          config: {
            number: [100000],
            content: "{nt}次",
            textAlign: "left",
            style: {
              fontSize: 20,
              fill: "#00d8ff",
            },
          },
        },
        {
          name: "上解金额",
          value: 200000,
          prefixClass: "orange",
          config: {
            number: [200000],
            content: "{nt}万元",
            formatter: this.formatNum,
            textAlign: "left",
            style: {
              fontSize: 20,
              fill: "rgb(245, 158, 110)",
            },
          },
        },
      ],
    };
  },

  mounted() {},

  methods: {
    formatNum(num) {
      let obj = numConversion({ numString: num, unit: "万" });
      return obj.value;
    },
  },
};
</script>

<style lang="scss" scoped>
.wrap {
  padding: 20px;
  position: relative;
  .block-bottom {
    overflow: hidden;
    width: 95%;
    margin: 0 auto;
    .b-item {
      margin-top: 20px;
      .prefix {
        &.blue {
          color: #00d8ff;
        }
        &.orange {
          color: rgb(245, 158, 110);
        }
        font-size: 12px;
      }
      .tit {
        font-size: 12px;
        margin-left: 8px;
      }
      .digital {
        width: 145px;
        height: 30px;
        margin-left: 18px;
        // margin-top: -3px;
        // margin-left: 10px;
      }
    }
  }
}
</style>
